ActionController::Routing::Routes.draw do |map|
  map.home '', :controller => 'articles', :action => 'index'
  map.signup 'signup', :controller => 'users', :action => 'new'
  map.login  'login', :controller => 'sessions', :action => 'new'
  map.logout 'logout', :controller => 'sessions', :action => 'destroy'

  map.resources :tags, :sessions
  map.resources :tags, :member => { :delete => :get }
  map.resources :users do |user|
    user.resources :tokens
    user.resources :tokens, :member => { :delete => :get }
  end  
  map.resources :articles do |article|
    article.resources :comments
    article.resources :comments, :member => { :delete => :get }
  end
  map.resources :articles, :member => { :delete => :get }

  # Install the default route as the lowest priority.
  map.connect ':controller/:action/:id'
end
